/*
 * @Author: bewilder-cell 1761877578@qq.com
 * @Date: 2022-09-25 20:12:56
 * @LastEditors: bewilder-cell 1761877578@qq.com
 * @LastEditTime: 2023-02-06 17:00:39
 * @FilePath: \vite-demo-work\src\components\demo1\tiket.jsx
 * @Description: 
 * 
 * Copyright (c) 2023 by ${git_name_email}, All Rights Reserved. 
 */
import { useLocation, useParams,useNavigate } from "react-router-dom";
import { getInvoice } from "./data";

export default function Invoice() {
  let params = useParams();
  let location =useLocation()
  const nav = useNavigate()
  console.log(params,location,"nav",nav)
  let invoice = getInvoice(parseInt(params.id, 10));
  return (
    <main style={{ padding: "1rem" }}>
      <h2>Total Due: {invoice.amount}</h2>
      <p>
        {invoice.name}: {invoice.number}
      </p>
      <p>Due Date: {invoice.due}</p>
    </main>
  );
}